<html>
<head><meta charset="utf-8"><title>how do I save the state of a rebase? · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20do.20I.20save.20the.20state.20of.20a.20rebase.3F.html">how do I save the state of a rebase?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="216808368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20do%20I%20save%20the%20state%20of%20a%20rebase%3F/near/216808368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20do.20I.20save.20the.20state.20of.20a.20rebase.3F.html#216808368">(Nov 15 2020 at 19:05)</a>:</h4>
<p>I want to report a rust-analyzer bug that showed up in the middle of a complicated rebase - is there a way to save my current state to a tag, push that to github, then get back to the state in the rebase?</p>



<a name="216808420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20do%20I%20save%20the%20state%20of%20a%20rebase%3F/near/216808420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20do.20I.20save.20the.20state.20of.20a.20rebase.3F.html#216808420">(Nov 15 2020 at 19:06)</a>:</h4>
<p>oh god oh no why <a href="https://stackoverflow.com/questions/41685791/how-can-i-save-a-git-rebase-in-progress">https://stackoverflow.com/questions/41685791/how-can-i-save-a-git-rebase-in-progress</a></p>



<a name="216808428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20do%20I%20save%20the%20state%20of%20a%20rebase%3F/near/216808428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20do.20I.20save.20the.20state.20of.20a.20rebase.3F.html#216808428">(Nov 15 2020 at 19:06)</a>:</h4>
<p>any git answer that starts with an ascii diagram has already gone wrong</p>



<a name="216808620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20do%20I%20save%20the%20state%20of%20a%20rebase%3F/near/216808620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20do.20I.20save.20the.20state.20of.20a.20rebase.3F.html#216808620">(Nov 15 2020 at 19:12)</a>:</h4>
<p>ok this is close enough <a href="https://github.com/rust-analyzer/rust-analyzer/issues/6560">https://github.com/rust-analyzer/rust-analyzer/issues/6560</a></p>



<a name="216827037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20do%20I%20save%20the%20state%20of%20a%20rebase%3F/near/216827037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20do.20I.20save.20the.20state.20of.20a.20rebase.3F.html#216827037">(Nov 16 2020 at 02:22)</a>:</h4>
<p>maybe this tool is useful for this kind of cases <a href="https://github.com/mhagger/git-imerge">https://github.com/mhagger/git-imerge</a></p>



<a name="216827251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20do%20I%20save%20the%20state%20of%20a%20rebase%3F/near/216827251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20do.20I.20save.20the.20state.20of.20a.20rebase.3F.html#216827251">(Nov 16 2020 at 02:28)</a>:</h4>
<p>that looks amazing, thank you!</p>



<a name="217119347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20do%20I%20save%20the%20state%20of%20a%20rebase%3F/near/217119347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Henry-Mantilla <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20do.20I.20save.20the.20state.20of.20a.20rebase.3F.html#217119347">(Nov 18 2020 at 10:49)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/122651-general/topic/how.20do.20I.20save.20the.20state.20of.20a.20rebase.3F/near/216808428">said</a>:</p>
<blockquote>
<p>any git answer that starts with an ascii diagram has already gone wrong</p>
</blockquote>
<p><span aria-label="big smile" class="emoji emoji-1f604" role="img" title="big smile">:big_smile:</span>  But to be fair, the answer in that post fits one line: to <code>git branch</code> (or even better: <code>git tag</code>) to label the current state of <code>HEAD</code>, and <em>voilà</em>. They've just happened not to write the TL,DR anywhere, and gone in great lengths to also explain how rebasing works and why that one liner works too, with added ASCII diagrams! Which is nice … but hard to skim <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span> </p>
<p>I'll just add that a pretty nifty thing to do here is to use a <code>worktree</code>: <code>git worktree add path/to/a/new/dir -b new-branch-name</code> such as, if your are at the root of the <code>rust</code> repo:</p>
<div class="codehilite" data-code-language="Bash"><pre><span></span><code>git worktree add ../rust-break-ra -b rust-break-ra
</code></pre></div>
<p>This way, your <code>rust</code> dir is still rebasing, but within that <code>rust-break-ra</code> newly created directory, you should be able to push your branch (maybe with a <code>git rebase abort</code> there, haven't tested it)</p>



<a name="217134398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20do%20I%20save%20the%20state%20of%20a%20rebase%3F/near/217134398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20do.20I.20save.20the.20state.20of.20a.20rebase.3F.html#217134398">(Nov 18 2020 at 13:33)</a>:</h4>
<p><span class="user-mention" data-user-id="232018">@Daniel Henry-Mantilla</span> hmm that loses the state of the index though - I'd almost finished resolving the conflicts for a commit when I ran into this</p>



<a name="217134477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20do%20I%20save%20the%20state%20of%20a%20rebase%3F/near/217134477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20do.20I.20save.20the.20state.20of.20a.20rebase.3F.html#217134477">(Nov 18 2020 at 13:34)</a>:</h4>
<p>The bright idea I had was to make a temporary commit, tag that, finish the rebase, then run <em>another</em> rebase to get rid of the temporary commit</p>



<a name="217134579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20do%20I%20save%20the%20state%20of%20a%20rebase%3F/near/217134579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Henry-Mantilla <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20do.20I.20save.20the.20state.20of.20a.20rebase.3F.html#217134579">(Nov 18 2020 at 13:35)</a>:</h4>
<p>I wonder if it is possible to make a <code>worktree</code> branch bundling the unstaged changes <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>